package com.limf.demo.java8.annotation;

import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import org.apache.commons.lang3.AnnotationUtils;

public class UseCaseTracker {

	public static void trackUseCase(List<Integer> useCase, Class<?> c1) {
		
		for(Method m: c1.getDeclaredMethods()) {
			CustomAnnotation customAnnotation = m.getAnnotation(CustomAnnotation.class);
			if(customAnnotation != null) {
				System.out.println("Found case:"+customAnnotation.id()+"  "+ customAnnotation.description());
				useCase.remove(new Integer(customAnnotation.id()));
			}
		}
		for(int i : useCase) {
			System.out.println("Warning : Messing use case - "+i);
		}
	}
	public static void main(String[] args) {
		List<Integer> userCase = new ArrayList<>();
		Collections.addAll(userCase, 100, 101, 102);
		trackUseCase(userCase, AnnotationTest.class);
		
	}
}
